package com.whmskj.xjlhsc.mobie.index.controller;

import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.mobie.index.entity.vo.XsTrendVo;
import com.whmskj.xjlhsc.mobie.index.service.IndexService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author 张
 * @version 1.0
 */

@RestController
@RequestMapping("/mob/index")
@Tag(description = "首页接口",name = "首页接口")
@Slf4j
public class IndexController {

    @Autowired
    private IndexService indexService;
    @GetMapping("xsEnergy")
        @Operation(description = "首页细纱能耗")
    public Result xsEnergy(){
      Map<String,Object> map = indexService.xsEnergy();
      return Result.success(map);
    }
    @GetMapping("xsTrend")
    @Operation(description = "细纱能耗趋势")
    public Result xsTrend(){
        List<XsTrendVo> map = indexService.xsTrend();
        return Result.success(map);
    }
    @GetMapping("getState")
    @Operation(description = "获取机器状态")
    public Result getState(){
        return Result.success(indexService.getState());
    }

}
